<template>
    <div id="box">
        
        <div class="title" v-for="goods in goods" :key="goods.id">
            <div class="pic">
                <img :src="goods.img" alt="">
            </div>
            <div class="right">
                <p>{{goods.name}}</p>
                <div>非亲子</div>
            </div>
        </div>
        <div class="other" v-for="goods in goods" :key="goods.id">
            <div class="price">￥{{goods.price}}</div>
            <ul>
                <li><div class="icon">!</div>不支持退</li>
                <li><div class="icon">√</div>可选座</li>
                <li><div class="icon">√</div>自助取票</li>
                <li><div class="icon">√</div>电子发票</li>
            </ul>
            <div class="time">
                <h2>{{goods.date}}</h2>
                <p>{{goods.time}} 分钟</p>
            </div>
            <div class="address">
                <h2>{{goods.address}}</h2>
                <p>{{goods.addressdetail}}</p>
            </div>
        </div>
    </div>
</template>

<script>
import axios from "axios";

export default {
    name:"Basic",
    created() {
        this.num=this.$route.params.id ||this.$route.query.num;
        axios({
        url: "/goods",
        method: "get",
        params:{
            id:this.num
        }
        })
        .then(res => {
            this.goods=res.data;
        });
    },
    data(){
        return{
            goods:[],
            num:""
        }
    }
}
</script>

<style scoped>
#box{
    height:3.12rem;
    background: #536387;
    border-bottom: 0.1rem solid #f6f7f9
}

.title{
    height: 0.89rem;
    width: 3.32rem;
    margin: 0 auto;
}
.title .pic{
    width: 1.03rem;
    height: 1.37rem;
    border-radius: 0.05rem;
    margin-top: 0.04rem;
    float: left;
    overflow: hidden;
}
.title .pic img{
    width: 100%;
    height: 100%;
}
.right{
    width: 2.17rem;
    height: 100%;
    float: right;
}
.right p{
    line-height: 0.3rem;
    font-size: 0.15rem;
    color: #fefffc;
    font-weight: bold;
}
.right div{
    width: 0.45rem;
    border: 0.01rem solid #fefffc;
    font-size: 0.08rem;
    color: #fefffc;
    padding: 0.01rem 0.02rem;
    border-radius: 0.1rem;
    text-align: center;
    margin-top: 0.03rem;
}
.other{
    height: 2.24rem;
    width: 100%;
    background: #fff;
    margin: 0 auto;
    border-radius: 0.11rem 0.11rem 0 0
}
.other .price{
    font-size: 0.13rem;
    color: #f3195e;
    margin-top: 0.28rem;
    margin-left: 0.13rem;
    float: left;
}
.other ul{
    height: 0.4rem;
    width: 3.32rem;
    margin-left: 0.18rem;
    float: left;
    display:flex;
    justify-content: space-around;
    align-items: center;
    border-bottom: 0.01rem solid #eee;
}
.other ul li{
    float: left;
    font-size: 0.13rem;
    color: #9998a1;
    width: 24%;
}
.other .icon{
    font-size: 0.07rem;
    width: 0.2rem;
    height: 0.2rem;
    line-height: 0.2rem;
    text-align: center;
    border-radius: 50%;
    background: #ff972c;
    color: #fff;
    margin-right: 0.0502rem;
    display: inline-block
}
.other .time{
    width:3.32rem;
    height:0.55rem;
    margin-left: 0.18rem;
    float: left;
    border-bottom: 0.01rem solid #eee;
}
.time h2{
    font-size: 0.11rem;
    margin-top: 0.1rem;
}
.time p{
    font-size: 0.11rem;
    color: #9f9fa1;
    margin-top: 0.05rem;
}
.other .address{
    width:3.32rem;
    height:0.55rem;
    margin-left: 0.18rem;
    float: left;
}
.address h2{
    font-size: 0.11rem;
    margin-top: 0.18rem;
}
.address p{
    font-size: 0.11rem;
    color: #9f9fa1;
    margin-top: 0.05rem;
}
</style>
